import { useEffect } from 'react';
import { useState } from 'react'
import MyComponent from './MyComponent'
import './App.css'

function App() {
  const [satisfaction, setSatisfaction] = useState(300);
  console.log('App 更新了')
  useEffect(() => {
    setTimeout(() => {
      setSatisfaction(330)
    }, 3000)
  }, [])

  return (
    <div className="App">
      
      <input 
        type="range"
        min="0"
        max="500"
        value={satisfaction}
        onChange={(event) => setSatisfaction(+event.target.value)}
      />
      <MyComponent level={satisfaction} />
    </div>
  )
}

export default App
